/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.g;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.login.plugin.h.e;
import com.qihoo.gamecenter.sdk.login.plugin.h.f;
import org.json.JSONException;
import org.json.JSONObject;

public abstract class c implements o {
    private boolean a = false;

    protected boolean a() {
        return this.a;
    }

    public void a(String paramString, Context paramContext) {
        e.a("CancelableCallback", new Object[] { "result=", paramString });
        if (a())
            return;
        try {
            if (!(TextUtils.isEmpty(paramString))) {
                JSONObject localJSONObject1 = new JSONObject(paramString);
                int i = localJSONObject1.getInt("error_code");
                String str = localJSONObject1.optString("error_msg");
                a(paramContext, i, str);
                JSONObject localJSONObject2 = localJSONObject1.optJSONObject("content");
                a(i, str, localJSONObject2);
                return;
            }
        } catch (JSONException localJSONException) {
            e.b("CancelableCallback", "", localJSONException);
        }
        a(0, "JSON PARSE ERROR!!!", null);
        return;
    }

    public abstract void a(int paramInt, String paramString, JSONObject paramJSONObject);

    protected void a(Context paramContext, int paramInt, String paramString) {
        if ((paramInt == 0) || (TextUtils.isEmpty(paramString)))
            return;
        f.a(paramContext, paramInt, paramString, false);
    }
}